package com.swust.exam.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RestController;


import com.swust.exam.pojo.Questionbank;
import com.swust.exam.service.QuestionbankService;


@RestController
public class QuestionbankController {
	@Autowired
	private QuestionbankService questionbankService;
	
	@GetMapping(value = "/questionbank/get")
	public Questionbank questionbankGet(int id)
	{
		return questionbankService.get(id);
	}
	
	
	@DeleteMapping(value="/questionbank/delete")
	public int questionbankDelete(int id) {
		return questionbankService.delete(id);
	}
	
	@PostMapping(value="/questionbank/insert")
	public int questionbankInsert(Questionbank questionbank) {
		return questionbankService.insert(questionbank);
	}
	
	@PutMapping(value="/questionbank/update")
	public int questionbankUpdate(Questionbank questionbank) {
		return questionbankService.update(questionbank);
	}
		

}
